With the popularity of mobile Internet services and applications such as Online Map, O2O (Online To Offline), more and more user location data is collected and stored. Geo-fence-based services, such as marketing push and security alert, are the most direct, most real-time and most effective explorations and use of user location data, and have broad application prospects.
A geo-fence is a geographical area enclosed by a virtual fence, and a device may receive push notifications or warnings when the device enters or leaves the area or moves in the area. Grid indexing technology is the foundation of geo-fence-based services. Gridding is a way of dividing two-dimensional geo-space, and each grid covers a certain geographical area. The geo-fence may be approximated as a grid set. A range covered by grids in the grid set s used to simulate the area contained in the geo-fence, which is used for fast retrieval and positioning of the geo-fence. The grids in the grid set are the index grids of the geo-fence.
In the prior art, a geo-fence is usually represented by a plurality of grids of the same granularity, and these index grids should completely cover the area contained in the geo-fence. In the case of the index grids of a coarser granularity, it is difficult to accurately represent the geo-fence, which may cause geo-fence based services to additionally disturb users who are not in the geo-fence. To avoid this problem, the precision of the index grids is usually required to exceed a certain threshold, which often means finer-grained index grids and a sharp increase in the number of indexes. Indexes in a large data volume usually need to be stored in a distributed manner on multiple devices. The larger the data volume, the more complicated the management and maintenance of the indexes, and the slower the query speed, the lower the stability and response speed of a geo-fence-based service.